home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 22 / Cream of the Crop 22.iso / doom / quake1.zip / SPOT_V1.ZIP / SPOT3.PAT < prev   
Text File  |  1996-08-15  |  42KB  |  1,483 lines

  1. diff -urPBb ..\v101qc/ai.qc diff/ai.qc
  2. --- ..\v101qc/ai.qc    Wed Jul 24 23:51:22 1996
  3. +++ diff/ai.qc    Wed Aug 14 09:32:00 1996
  4. @@ -13,7 +13,7 @@
  5.  The next path spot to walk toward.  If .enemy, ignore .movetarget.
  6.  When an enemy is killed, the monster will try to return to it's path.
  7.  
  8. -.huntt_ime
  9. +.hunt_time
  10.  Set to time + something when the player is in sight, but movement straight for
  11.  him is blocked.  This causes the monster to use wall following code for
  12.  movement direction instead of sighting on the player.
  13. @@ -326,12 +326,40 @@
  14.          sight_entity_time = time;
  15.      }
  16.      
  17. +    if(self.enemy!=self.pet) 
  18.      self.show_hostile = time + 1;        // wake up other monsters
  19. +//      else {
  20. +//              dprint(self.classname);
  21. +//              dprint(" has a pet ");
  22. +//              dprint(self.pet.classname);
  23. +//              dprint(".\n");
  24. +//      }
  25.  
  26.      SightSound ();
  27.      HuntTarget ();
  28.  };
  29.  
  30. +void() PetMove = 
  31. +{
  32. +//Modified by J. Faske -- try to make the pet move out of the way
  33. +    local vector dtemp;
  34. +    local float dir;
  35. +    if(other != self.pet) return; // We don't want someone else pushing
  36. +    dtemp = vectoangles(self.pet.velocity);
  37. +    dir = vectoyaw(dtemp);
  38. +    dir = dir + 90;
  39. +    dir = anglemod(dir);
  40. +    if (walkmove(dir, 7))
  41. +        return;
  42. +    dir = dir + 180 ;
  43. +    dir = anglemod(dir);
  44. +    if (walkmove(dir, 7))
  45. +        return;
  46. +    dir = dir + 90;
  47. +    dir = anglemod(dir);
  48. +    walkmove(dir, 7);
  49. +};
  50. +
  51.  /*
  52.  ===========
  53.  FindTarget
  54. @@ -349,9 +377,11 @@
  55.  slower noticing monsters.
  56.  ============
  57.  */
  58. +void(entity newpet) player_addpet;
  59. +
  60.  float() FindTarget =
  61.  {
  62. -    local entity    client;
  63. +    local entity    client, oldself;
  64.      local float        r;
  65.  
  66.  // if the first spawnflag bit is set, the monster will only wake up on
  67. @@ -413,6 +443,15 @@
  68.          }
  69.      }
  70.      
  71. +    if ((self.flags & FL_FRIENDLY) & (!self.pet)) {
  72. +        self.touch=PetMove;
  73. +        self.pet=self.enemy;
  74. +        oldself=self;
  75. +        self=self.pet;
  76. +        player_addpet(oldself);
  77. +        self=oldself;
  78. +    }
  79. +
  80.      FoundTarget ();
  81.  
  82.      return TRUE;
  83. @@ -497,13 +536,26 @@
  84.  The monster is staying in one place for a while, with slight angle turns
  85.  =============
  86.  */
  87. +void() PetMove ;
  88.  void() ai_stand =
  89.  {
  90. +    local float r;
  91.      if (FindTarget ())
  92.          return;
  93.      
  94.      if (time > self.pausetime)
  95.      {
  96. +        if(self.pet) {
  97. +            self.touch = PetMove ;
  98. +            r=range(self.pet);
  99. +            if(r==RANGE_MELEE)
  100. +                return;
  101. +            else if(r==RANGE_MID)
  102. +                self.th_walk ();
  103. +            else
  104. +                self.th_run ();
  105. +        }
  106. +        else
  107.          self.th_walk ();
  108.          return;
  109.      }
  110. @@ -677,12 +729,22 @@
  111.  void(float dist) ai_run =
  112.  {
  113.      local    vector    delta;
  114. +    local   float   test;
  115.      local    float    axis;
  116.      local    float    direct, ang_rint, ang_floor, ang_ceil;
  117.      
  118.      movedist = dist;
  119.  // see if the enemy is dead
  120. -    if (self.enemy.health <= 0)
  121. +    if (self.classname == "monster_dog"
  122. +        || self.classname == "monster_shambler"
  123. +        || self.classname == "monster_demon") 
  124. +        // Those guys are viscious
  125. +            test=1;
  126. +    else {
  127. +        test = (self.enemy.flags & FL_MONSTER) == FL_MONSTER;
  128. +        test = test + (self.enemy.classname == "player");
  129. +    }
  130. +    if (!test || self.enemy.health <= 0)
  131.      {
  132.          self.enemy = world;
  133.      // FIXME: look all around for other targets
  134. @@ -693,7 +755,14 @@
  135.          }
  136.          else
  137.          {
  138. -            if (self.movetarget)
  139. +            if (self.pet)
  140. +                if(self.pet.health > 0) {
  141. +                    self.enemy = self.pet;
  142. +                    HuntTarget();
  143. +                } else {
  144. +                    self.pet=world;
  145. +                }
  146. +            else if (self.movetarget)
  147.                  self.th_walk ();
  148.              else
  149.                  self.th_stand ();
  150. @@ -701,13 +770,25 @@
  151.          }
  152.      }
  153.  
  154. -    self.show_hostile = time + 1;        // wake up other monsters
  155.  
  156.  // check knowledge of enemy
  157.      enemy_vis = visible(self.enemy);
  158.      if (enemy_vis)
  159.          self.search_time = time + 5;
  160.  
  161. +// Okay, just find our pet
  162. +    if(self.enemy == self.pet) {
  163. +        // head straight in
  164. +        if(range(self.pet) == RANGE_MELEE) {
  165. +            self.pausetime=time+1;
  166. +            self.th_stand();
  167. +        } else
  168. +            movetogoal (dist);              // done in C code...
  169. +        return;
  170. +    }
  171. +        
  172. +    self.show_hostile = time + 1;           // wake up other monsters
  173. +
  174.  // look for other coop players
  175.      if (coop && self.search_time < time)
  176.      {
  177. diff -urPBb ..\v101qc/client.qc diff/client.qc
  178. --- ..\v101qc/client.qc    Wed Jul 24 23:51:22 1996
  179. +++ diff/client.qc    Mon Aug 12 15:23:08 1996
  180. @@ -2,7 +2,7 @@
  181.  // prototypes
  182.  void () W_WeaponFrame;
  183.  void() W_SetCurrentAmmo;
  184. -void() player_pain;
  185. +void(entity e, float f) player_pain;
  186.  void() player_stand1;
  187.  void (vector org) spawn_tfog;
  188.  void (vector org, entity death_owner) spawn_tdeath;
  189. @@ -57,7 +57,7 @@
  190.  
  191.  void() SetNewParms =
  192.  {
  193. -    parm1 = IT_SHOTGUN | IT_AXE;
  194. +    parm1 = IT_SHOTGUN | IT_AXE | IT_EXTRA_WEAPON;
  195.      parm2 = 100;
  196.      parm3 = 0;
  197.      parm4 = 25;
  198. @@ -70,6 +70,7 @@
  199.  
  200.  void() DecodeLevelParms =
  201.  {
  202. +    local entity pettemp;
  203.      if (serverflags)
  204.      {
  205.          if (world.model == "maps/start.bsp")
  206. @@ -85,6 +86,14 @@
  207.      self.ammo_cells = parm7;
  208.      self.weapon = parm8;
  209.      self.armortype = parm9 * 0.01;
  210. +//Added by J. Faske -- can't take your pets with you between levels
  211. +    while (self.petlist)
  212. +    {        
  213. +        pettemp = self.petlist;
  214. +        self.petlist = pettemp.petlist;
  215. +        remove(pettemp);
  216. +    }
  217. +//End addition                
  218.  };
  219.  
  220.  /*
  221. diff -urPBb ..\v101qc/combat.qc diff/combat.qc
  222. --- ..\v101qc/combat.qc    Wed Jul 24 23:51:22 1996
  223. +++ diff/combat.qc    Mon Aug 12 12:59:30 1996
  224. @@ -149,7 +149,7 @@
  225.  
  226.  // check for godmode or invincibility
  227.      if (targ.flags & FL_GODMODE)
  228. -        return;
  229. +        take=0;
  230.      if (targ.invincible_finished >= time)
  231.      {
  232.          if (self.invincible_sound < time)
  233. diff -urPBb ..\v101qc/defs.qc diff/defs.qc
  234. --- ..\v101qc/defs.qc    Wed Jul 24 23:51:22 1996
  235. +++ diff/defs.qc    Mon Aug 12 14:44:10 1996
  236. @@ -240,6 +240,7 @@
  237.  float    FL_PARTIALGROUND        = 1024;    // not all corners are valid
  238.  float    FL_WATERJUMP            = 2048;    // player jumping out of water
  239.  float    FL_JUMPRELEASED            = 4096;    // for jump debouncing
  240. +float    FL_FRIENDLY            = 8192;
  241.  
  242.  // edict.movetype values
  243.  float    MOVETYPE_NONE            = 0;    // never moves
  244. @@ -690,4 +691,5 @@
  245.  
  246.  float(entity targ, entity inflictor) CanDamage;
  247.  
  248. -
  249. +.entity    pet;
  250. +.entity    petlist;
  251. diff -urPBb ..\v101qc/demon.qc diff/demon.qc
  252. --- ..\v101qc/demon.qc    Wed Jul 24 23:51:22 1996
  253. +++ diff/demon.qc    Mon Aug 12 14:45:06 1996
  254. @@ -145,26 +145,32 @@
  255.  void()    demon1_die4        =[    $death4,        demon1_die5    ] {};
  256.  void()    demon1_die5        =[    $death5,        demon1_die6    ] {};
  257.  void()    demon1_die6        =[    $death6,        demon1_die7    ]
  258. -{self.solid = SOLID_NOT;};
  259. +{};
  260.  void()    demon1_die7        =[    $death7,        demon1_die8    ] {};
  261.  void()    demon1_die8        =[    $death8,        demon1_die9    ] {};
  262.  void()    demon1_die9        =[    $death9,        demon1_die9 ] {};
  263.  
  264.  void() demon_die =
  265.  {
  266. +//Added by J. Faske -- removes the link for self from the petlist
  267. +RemovePet(self);
  268. +//End addition
  269.  // check for gib
  270.      if (self.health < -80)
  271.      {
  272.          sound (self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM);
  273. -        ThrowHead ("progs/h_demon.mdl", self.health);
  274. -        ThrowGib ("progs/gib1.mdl", self.health);
  275. -        ThrowGib ("progs/gib1.mdl", self.health);
  276. -        ThrowGib ("progs/gib1.mdl", self.health);
  277. +//        ThrowHead ("progs/h_demon.mdl", self.health);
  278. +//        ThrowGib ("progs/gib1.mdl", self.health);
  279. +//        ThrowGib ("progs/gib1.mdl", self.health);
  280. +//        ThrowGib ("progs/gib1.mdl", self.health);
  281. +        monster_gib("progs/h_demon.mdl");
  282.          return;
  283.      }
  284.  
  285.  // regular death
  286.      demon1_die1 ();
  287. +
  288. +    monster_corpse_setup('-16 -16 -24', '16 16 -12', "progs/h_demon.mdl");
  289.  };
  290.  
  291.  
  292. @@ -177,23 +183,8 @@
  293.  /*QUAKED monster_demon1 (1 0 0) (-32 -32 -24) (32 32 64) Ambush
  294.  
  295.  */
  296. -void() monster_demon1 =
  297. +void() _monster_demon1 =
  298.  {
  299. -    if (deathmatch)
  300. -    {
  301. -        remove(self);
  302. -        return;
  303. -    }
  304. -    precache_model ("progs/demon.mdl");
  305. -    precache_model ("progs/h_demon.mdl");
  306. -
  307. -    precache_sound ("demon/ddeath.wav");
  308. -    precache_sound ("demon/dhit2.wav");
  309. -    precache_sound ("demon/djump.wav");
  310. -    precache_sound ("demon/dpain1.wav");
  311. -    precache_sound ("demon/idle1.wav");
  312. -    precache_sound ("demon/sight2.wav");
  313. -
  314.      self.solid = SOLID_SLIDEBOX;
  315.      self.movetype = MOVETYPE_STEP;
  316.  
  317. @@ -213,6 +204,24 @@
  318.      walkmonster_start();
  319.  };
  320.  
  321. +void () monster_demon1 =
  322. +{
  323. +    if (deathmatch)
  324. +    {
  325. +        remove(self);
  326. +        return;
  327. +    }
  328. +    precache_model ("progs/demon.mdl");
  329. +    precache_model ("progs/h_demon.mdl");
  330. +
  331. +    precache_sound ("demon/ddeath.wav");
  332. +    precache_sound ("demon/dhit2.wav");
  333. +    precache_sound ("demon/djump.wav");
  334. +    precache_sound ("demon/dpain1.wav");
  335. +    precache_sound ("demon/idle1.wav");
  336. +    precache_sound ("demon/sight2.wav");
  337. +    _monster_demon1();
  338. +};
  339.  
  340.  /*
  341.  ==============================================================================
  342. diff -urPBb ..\v101qc/dog.qc diff/dog.qc
  343. --- ..\v101qc/dog.qc    Wed Jul 24 23:51:22 1996
  344. +++ diff/dog.qc    Mon Aug 12 14:45:42 1996
  345. @@ -228,25 +228,35 @@
  346.  
  347.  void() dog_die =
  348.  {
  349. +// added by J. Faske -- removes the monster from his petlist
  350. +    RemovePet(self);
  351. +// end addition
  352. +
  353.  // check for gib
  354.      if (self.health < -35)
  355.      {
  356.          sound (self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM);
  357. -        ThrowGib ("progs/gib3.mdl", self.health);
  358. -        ThrowGib ("progs/gib3.mdl", self.health);
  359. -        ThrowGib ("progs/gib3.mdl", self.health);
  360. -        ThrowHead ("progs/h_dog.mdl", self.health);
  361. +//        ThrowGib ("progs/gib3.mdl", self.health);
  362. +//        ThrowGib ("progs/gib3.mdl", self.health);
  363. +//        ThrowGib ("progs/gib3.mdl", self.health);
  364. +//        ThrowHead ("progs/h_dog.mdl", self.health);
  365. +        monster_gib("progs/h_dog.mdl");
  366.          return;
  367.      }
  368.  
  369.  // regular death
  370.      sound (self, CHAN_VOICE, "dog/ddeath.wav", 1, ATTN_NORM);
  371. -    self.solid = SOLID_NOT;
  372. +//    self.solid = SOLID_NOT;
  373.  
  374.      if (random() > 0.5)
  375.          dog_die1 ();
  376.      else
  377.          dog_dieb1 ();
  378. +
  379. +// We want a corpse:  No actions, a little health, and a new .th_die
  380. +// Frob some flags so we're damagable as well
  381. +
  382. +    monster_corpse_setup('-32 -32 -24', '32 32 -12',"progs/h_dog.mdl"); 
  383.  };
  384.  
  385.  //============================================================================
  386. @@ -327,22 +337,9 @@
  387.  /*QUAKED monster_dog (1 0 0) (-32 -32 -24) (32 32 40) Ambush
  388.  
  389.  */
  390. -void() monster_dog =
  391. -{
  392. -    if (deathmatch)
  393. -    {
  394. -        remove(self);
  395. -        return;
  396. -    }
  397. -    precache_model ("progs/h_dog.mdl");
  398. -    precache_model ("progs/dog.mdl");
  399. -
  400. -    precache_sound ("dog/dattack1.wav");
  401. -    precache_sound ("dog/ddeath.wav");
  402. -    precache_sound ("dog/dpain1.wav");
  403. -    precache_sound ("dog/dsight.wav");
  404. -    precache_sound ("dog/idle.wav");
  405.  
  406. +void() _monster_dog =
  407. +{
  408.      self.solid = SOLID_SLIDEBOX;
  409.      self.movetype = MOVETYPE_STEP;
  410.  
  411. @@ -360,4 +357,22 @@
  412.      self.th_missile = dog_leap1;
  413.  
  414.      walkmonster_start();
  415. +};
  416. +
  417. +void() monster_dog = {
  418. +    if (deathmatch)
  419. +    {
  420. +        remove(self);
  421. +        return;
  422. +    }
  423. +
  424. +    precache_model ("progs/h_dog.mdl");
  425. +    precache_model ("progs/dog.mdl");
  426. +
  427. +    precache_sound ("dog/dattack1.wav");
  428. +    precache_sound ("dog/ddeath.wav");
  429. +    precache_sound ("dog/dpain1.wav");
  430. +    precache_sound ("dog/dsight.wav");
  431. +    precache_sound ("dog/idle.wav");
  432. +    _monster_dog();
  433.  };
  434. diff -urPBb ..\v101qc/enforcer.qc diff/enforcer.qc
  435. --- ..\v101qc/enforcer.qc    Wed Jul 24 23:51:22 1996
  436. +++ diff/enforcer.qc    Mon Aug 12 12:59:38 1996
  437. @@ -256,7 +256,7 @@
  438.  void()    enf_die1    =[    $death1,    enf_die2    ] {};
  439.  void()    enf_die2    =[    $death2,    enf_die3    ] {};
  440.  void()    enf_die3    =[    $death3,    enf_die4    ]
  441. -{self.solid = SOLID_NOT;self.ammo_cells = 5;DropBackpack();};
  442. +{self.ammo_cells = 5;DropBackpack();};
  443.  void()    enf_die4    =[    $death4,    enf_die5    ] {ai_forward(14);};
  444.  void()    enf_die5    =[    $death5,    enf_die6    ] {ai_forward(2);};
  445.  void()    enf_die6    =[    $death6,    enf_die7    ] {};
  446. @@ -274,7 +274,7 @@
  447.  };
  448.  void()    enf_fdie2    =[    $fdeath2,    enf_fdie3    ] {};
  449.  void()    enf_fdie3    =[    $fdeath3,    enf_fdie4    ] 
  450. -{self.solid = SOLID_NOT;self.ammo_cells = 5;DropBackpack();};
  451. +{self.ammo_cells = 5;DropBackpack();};
  452.  void()    enf_fdie4    =[    $fdeath4,    enf_fdie5    ] {};
  453.  void()    enf_fdie5    =[    $fdeath5,    enf_fdie6    ] {};
  454.  void()    enf_fdie6    =[    $fdeath6,    enf_fdie7    ] {};
  455. @@ -291,10 +291,11 @@
  456.      if (self.health < -35)
  457.      {
  458.          sound (self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM);
  459. -        ThrowHead ("progs/h_mega.mdl", self.health);
  460. -        ThrowGib ("progs/gib1.mdl", self.health);
  461. -        ThrowGib ("progs/gib2.mdl", self.health);
  462. -        ThrowGib ("progs/gib3.mdl", self.health);
  463. +//        ThrowHead ("progs/h_mega.mdl", self.health);
  464. +//        ThrowGib ("progs/gib1.mdl", self.health);
  465. +//        ThrowGib ("progs/gib2.mdl", self.health);
  466. +//        ThrowGib ("progs/gib3.mdl", self.health);
  467. +        monster_gib("progs/h_mega.mdl");
  468.          return;
  469.      }
  470.  
  471. @@ -304,6 +305,8 @@
  472.          enf_die1 ();
  473.      else
  474.          enf_fdie1 ();
  475. +
  476. +    monster_corpse_setup('-16 -16 -24', '16 16 -8', "progs/h_mega.mdl");
  477.  };
  478.  
  479.  
  480. diff -urPBb ..\v101qc/hknight.qc diff/hknight.qc
  481. --- ..\v101qc/hknight.qc    Wed Jul 24 23:51:24 1996
  482. +++ diff/hknight.qc    Mon Aug 12 12:59:38 1996
  483. @@ -175,7 +175,7 @@
  484.  void()    hknight_die1    =[    $death1,    hknight_die2    ] {ai_forward(10);};
  485.  void()    hknight_die2    =[    $death2,    hknight_die3    ] {ai_forward(8);};
  486.  void()    hknight_die3    =[    $death3,    hknight_die4    ]
  487. -{self.solid = SOLID_NOT; ai_forward(7);};
  488. +{ai_forward(7);};
  489.  void()    hknight_die4    =[    $death4,    hknight_die5    ] {};
  490.  void()    hknight_die5    =[    $death5,    hknight_die6    ] {};
  491.  void()    hknight_die6    =[    $death6,    hknight_die7    ] {};
  492. @@ -188,8 +188,7 @@
  493.  
  494.  void()    hknight_dieb1    =[    $deathb1,    hknight_dieb2    ] {};
  495.  void()    hknight_dieb2    =[    $deathb2,    hknight_dieb3    ] {};
  496. -void()    hknight_dieb3    =[    $deathb3,    hknight_dieb4    ]
  497. -{self.solid = SOLID_NOT;};
  498. +void()    hknight_dieb3    =[    $deathb3,    hknight_dieb4    ] {};
  499.  void()    hknight_dieb4    =[    $deathb4,    hknight_dieb5    ] {};
  500.  void()    hknight_dieb5    =[    $deathb5,    hknight_dieb6    ] {};
  501.  void()    hknight_dieb6    =[    $deathb6,    hknight_dieb7    ] {};
  502. @@ -203,10 +202,11 @@
  503.      if (self.health < -40)
  504.      {
  505.          sound (self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM);
  506. -        ThrowHead ("progs/h_hellkn.mdl", self.health);
  507. -        ThrowGib ("progs/gib1.mdl", self.health);
  508. -        ThrowGib ("progs/gib2.mdl", self.health);
  509. -        ThrowGib ("progs/gib3.mdl", self.health);
  510. +//        ThrowHead ("progs/h_hellkn.mdl", self.health);
  511. +//        ThrowGib ("progs/gib1.mdl", self.health);
  512. +//        ThrowGib ("progs/gib2.mdl", self.health);
  513. +//        ThrowGib ("progs/gib3.mdl", self.health);
  514. +        monster_gib("progs/h_hellkn.mdl");
  515.          return;
  516.      }
  517.  
  518. @@ -216,6 +216,7 @@
  519.          hknight_die1 ();
  520.      else
  521.          hknight_dieb1 ();
  522. +    monster_corpse_setup ( '-16 -16 -24', '16 16 -12', "progs/h_hellkn.mdl");
  523.  };
  524.  
  525.  
  526. diff -urPBb ..\v101qc/jsubs.qc diff/jsubs.qc
  527. --- ..\v101qc/jsubs.qc    Thu Jan  1 00:00:00 1970
  528. +++ diff/jsubs.qc    Mon Aug 12 12:59:40 1996
  529. @@ -0,0 +1,18 @@
  530. +void(string gibname, float dm) ThrowGib;
  531. +float() random;
  532. +
  533. +void() SUB_Gib =
  534. +{
  535. +    local vector x,y,v;
  536. +    x='1 0 0';
  537. +    y='0 1 0';
  538. +    v=x*(50-random()*100)+y*(50-random()*100);
  539. +    if (random() < 0.8)  // Meat spray only, most of the time
  540. +        SpawnMeatSpray(self.origin, v);
  541. +        else if (random() < 0.3)
  542. +                ThrowGib("progs/gib1.mdl", self.health);
  543. +        else if (random() < 0.5)
  544. +                ThrowGib("progs/gib2.mdl", self.health);
  545. +        else
  546. +                ThrowGib("progs/gib3.mdl", self.health);
  547. +};
  548. diff -urPBb ..\v101qc/knight.qc diff/knight.qc
  549. --- ..\v101qc/knight.qc    Wed Jul 24 23:51:24 1996
  550. +++ diff/knight.qc    Mon Aug 12 12:59:40 1996
  551. @@ -185,8 +185,7 @@
  552.  
  553.  void()    knight_die1    =[    $death1,    knight_die2    ] {};
  554.  void()    knight_die2    =[    $death2,    knight_die3    ] {};
  555. -void()    knight_die3    =[    $death3,    knight_die4    ] 
  556. -{self.solid = SOLID_NOT;};
  557. +void()    knight_die3    =[    $death3,    knight_die4    ] {};
  558.  void()    knight_die4    =[    $death4,    knight_die5    ] {};
  559.  void()    knight_die5    =[    $death5,    knight_die6    ] {};
  560.  void()    knight_die6    =[    $death6,    knight_die7    ] {};
  561. @@ -198,8 +197,7 @@
  562.  
  563.  void()    knight_dieb1    =[    $deathb1,    knight_dieb2    ] {};
  564.  void()    knight_dieb2    =[    $deathb2,    knight_dieb3    ] {};
  565. -void()    knight_dieb3    =[    $deathb3,    knight_dieb4    ]     
  566. -{self.solid = SOLID_NOT;};
  567. +void()    knight_dieb3    =[    $deathb3,    knight_dieb4    ] {};
  568.  void()    knight_dieb4    =[    $deathb4,    knight_dieb5    ] {};
  569.  void()    knight_dieb5    =[    $deathb5,    knight_dieb6    ] {};
  570.  void()    knight_dieb6    =[    $deathb6,    knight_dieb7    ] {};
  571. @@ -216,10 +214,11 @@
  572.      if (self.health < -40)
  573.      {
  574.          sound (self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM);
  575. -        ThrowHead ("progs/h_knight.mdl", self.health);
  576. -        ThrowGib ("progs/gib1.mdl", self.health);
  577. -        ThrowGib ("progs/gib2.mdl", self.health);
  578. -        ThrowGib ("progs/gib3.mdl", self.health);
  579. +//        ThrowHead ("progs/h_knight.mdl", self.health);
  580. +//        ThrowGib ("progs/gib1.mdl", self.health);
  581. +//        ThrowGib ("progs/gib2.mdl", self.health);
  582. +//        ThrowGib ("progs/gib3.mdl", self.health);
  583. +        monster_gib("progs/h_knight.mdl");
  584.          return;
  585.      }
  586.  
  587. @@ -229,6 +228,7 @@
  588.          knight_die1 ();
  589.      else
  590.          knight_dieb1 ();
  591. +    monster_corpse_setup('-16 -16 -24', '16 16 -12', "progs/h_knight.mdl");
  592.  };
  593.  
  594.  
  595. diff -urPBb ..\v101qc/llsubs.qc diff/llsubs.qc
  596. --- ..\v101qc/llsubs.qc    Thu Jan  1 00:00:00 1970
  597. +++ diff/llsubs.qc    Mon Aug 12 12:59:40 1996
  598. @@ -0,0 +1,40 @@
  599. +entity(float size) SUB_Llinit =
  600. +{
  601. +    local float i=0;
  602. +    local entity head, current;
  603. +    head=world;
  604. +    while(i<size) {
  605. +        current=spawn();
  606. +        current.chain=head;
  607. +        head=current;
  608. +    }
  609. +    return head;
  610. +};
  611. +
  612. +        
  613. +entity(entity list, float index) SUB_Llaccess =
  614. +{
  615. +    local float i=0;
  616. +    local entity here;
  617. +    here=list;
  618. +    while(i<index&&here!=world) {
  619. +        here=here.chain;
  620. +    }
  621. +    return here.ent;
  622. +};
  623. +    
  624. +void(void (entity e) f, entity list) SUB_Lliter =
  625. +{
  626. +    while(list!=world) {
  627. +        f(list.ent);
  628. +        list=list.chain;
  629. +    }
  630. +};
  631. +
  632. +entity(float (entity e) f, entity list) SUB_Llfind =
  633. +{
  634. +    while(list!=world) {
  635. +        if (f(list.ent)) return list.ent;
  636. +        list=list.chain;
  637. +    }
  638. +};
  639. diff -urPBb ..\v101qc/monsters.qc diff/monsters.qc
  640. --- ..\v101qc/monsters.qc    Wed Jul 24 23:51:24 1996
  641. +++ diff/monsters.qc    Mon Aug 12 14:47:30 1996
  642. @@ -38,6 +38,53 @@
  643.      self.think = FoundTarget;
  644.  };
  645.  
  646. +void() monster_dead_push =
  647. +{
  648. +    local float dir;
  649. +    dir = vectoyaw(other.velocity);
  650. +    self.origin = self.origin + '0 0 1'; // Now we can be lifted, pushed off ledges, &c
  651. +    walkmove(dir, 7);
  652. +};
  653. +
  654. +void(string headmdl) monster_gib =
  655. +{
  656. +    ThrowGib ("progs/gib3.mdl", self.health);
  657. +    ThrowGib ("progs/gib3.mdl", self.health);
  658. +    ThrowGib ("progs/gib3.mdl", self.health);
  659. +    ThrowHead (headmdl, self.health);
  660. +};
  661. +    
  662. +void() monster_corpse_gib =
  663. +{
  664. +    monster_gib(self.weaponmodel);
  665. +};
  666. +
  667. +void(vector bb1, vector bb2, string headmdl) monster_corpse_setup =
  668. +{
  669. +    setsize(self, bb1, bb2);
  670. +    self.weaponmodel=headmdl; // This should be unused in monsters
  671. +    self.health=35;
  672. +    self.th_stand = SUB_Null;
  673. +    self.th_walk = SUB_Null;
  674. +    self.th_run = SUB_Null;
  675. +      self.th_pain = SUB_Gib;
  676. +      self.th_die = monster_corpse_gib;
  677. +    self.th_melee = SUB_Null;
  678. +    self.th_missile = SUB_Null;
  679. +    // self.touch = monster_dead_push; // This does funny things
  680. +    self.takedamage= DAMAGE_AIM; // grenades explode 
  681. +    self.flags = self.flags &! FL_MONSTER;  // Next "death" isn't counted
  682. +//Added by J. Faske
  683. +    if (self.classname == "monster_dog")
  684. +        self.classname = "dog_corpse";
  685. +    if (self.classname == "monster_army")
  686. +        self.classname = "army_corpse";
  687. +    if (self.classname == "monster_demon1")
  688. +        self.classname = "demon1_corpse";
  689. +    if (self.classname == "monster_shambler")
  690. +        self.classname = "shambler_corpse";
  691. +};
  692. +
  693.  /*
  694.  ================
  695.  monster_death_use
  696. @@ -76,9 +123,18 @@
  697.      
  698.      if (!walkmove(0,0))
  699.      {
  700. -        dprint ("walkmonster in wall at: ");
  701. -        dprint (vtos(self.origin));
  702. -        dprint ("\n");
  703. +//              dprint ("walkmonster in wall at: ");
  704. +//              dprint (vtos(self.origin));
  705. +//              dprint ("\n");
  706. +        sound (self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM);
  707. +        ThrowGib ("progs/gib1.mdl", self.health);
  708. +        ThrowGib ("progs/gib2.mdl", self.health);
  709. +        ThrowGib ("progs/gib3.mdl", self.health);
  710. +//Added by J. Faske -- removes self from petlist               
  711. +        RemovePet(self);
  712. +//End addition                
  713. +        remove(self);
  714. +        return;
  715.      }
  716.      
  717.      self.takedamage = DAMAGE_AIM;
  718. @@ -145,9 +201,15 @@
  719.  
  720.      if (!walkmove(0,0))
  721.      {
  722. -        dprint ("flymonster in wall at: ");
  723. -        dprint (vtos(self.origin));
  724. -        dprint ("\n");
  725. +//              dprint ("flymonster in wall at: ");
  726. +//              dprint (vtos(self.origin));
  727. +//              dprint ("\n");
  728. +        sound (self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM);
  729. +        ThrowGib ("progs/gib1.mdl", self.health);
  730. +        ThrowGib ("progs/gib2.mdl", self.health);
  731. +        ThrowGib ("progs/gib3.mdl", self.health);
  732. +        remove(self);
  733. +        return;
  734.      }
  735.  
  736.      if (self.target)
  737. diff -urPBb ..\v101qc/ogre.qc diff/ogre.qc
  738. --- ..\v101qc/ogre.qc    Wed Jul 24 23:51:24 1996
  739. +++ diff/ogre.qc    Mon Aug 12 12:59:42 1996
  740. @@ -354,8 +354,7 @@
  741.  void()    ogre_die1    =[    $death1,    ogre_die2    ] {};
  742.  void()    ogre_die2    =[    $death2,    ogre_die3    ] {};
  743.  void()    ogre_die3    =[    $death3,    ogre_die4    ]
  744. -{self.solid = SOLID_NOT;
  745. -self.ammo_rockets = 2;DropBackpack();};
  746. +{self.ammo_rockets = 2;DropBackpack();};
  747.  void()    ogre_die4    =[    $death4,    ogre_die5    ] {};
  748.  void()    ogre_die5    =[    $death5,    ogre_die6    ] {};
  749.  void()    ogre_die6    =[    $death6,    ogre_die7    ] {};
  750. @@ -371,8 +370,7 @@
  751.  void()    ogre_bdie1    =[    $bdeath1,    ogre_bdie2    ] {};
  752.  void()    ogre_bdie2    =[    $bdeath2,    ogre_bdie3    ] {ai_forward(5);};
  753.  void()    ogre_bdie3    =[    $bdeath3,    ogre_bdie4    ]
  754. -{self.solid = SOLID_NOT;
  755. -self.ammo_rockets = 2;DropBackpack();};
  756. +{self.ammo_rockets = 2;DropBackpack();};
  757.  void()    ogre_bdie4    =[    $bdeath4,    ogre_bdie5    ] {ai_forward(1);};
  758.  void()    ogre_bdie5    =[    $bdeath5,    ogre_bdie6    ] {ai_forward(3);};
  759.  void()    ogre_bdie6    =[    $bdeath6,    ogre_bdie7    ] {ai_forward(7);};
  760. @@ -387,10 +385,11 @@
  761.      if (self.health < -80)
  762.      {
  763.          sound (self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM);
  764. -        ThrowHead ("progs/h_ogre.mdl", self.health);
  765. -        ThrowGib ("progs/gib3.mdl", self.health);
  766. -        ThrowGib ("progs/gib3.mdl", self.health);
  767. -        ThrowGib ("progs/gib3.mdl", self.health);
  768. +//        ThrowHead ("progs/h_ogre.mdl", self.health);
  769. +//        ThrowGib ("progs/gib3.mdl", self.health);
  770. +//        ThrowGib ("progs/gib3.mdl", self.health);
  771. +//        ThrowGib ("progs/gib3.mdl", self.health);
  772. +        monster_gib("progs/h_ogre.mdl");
  773.          return;
  774.      }
  775.  
  776. @@ -400,6 +399,10 @@
  777.          ogre_die1 ();
  778.      else
  779.          ogre_bdie1 ();
  780. +// We want a corpse:  No actions, a little health, and a new .th_die
  781. +// Frob some flags so we're damagable as well
  782. +
  783. +    monster_corpse_setup('-16 -16 -24', '16 16 -8', "progs/h_ogre.mdl");
  784.  };
  785.  
  786.  void() ogre_melee =
  787. diff -urPBb ..\v101qc/player.qc diff/player.qc
  788. --- ..\v101qc/player.qc    Wed Jul 24 23:51:24 1996
  789. +++ diff/player.qc    Mon Aug 12 14:49:06 1996
  790. @@ -334,8 +334,21 @@
  791.  void()    player_axpain5 =    [    $axpain5,    player_axpain6    ] {};
  792.  void()    player_axpain6 =    [    $axpain6,    player_run    ] {};
  793.  
  794. -void() player_pain =
  795. +void(entity attacker, float take) player_pain =
  796.  {
  797. +    local entity list, previous, onepet;
  798. +    local entity oldself;
  799. +
  800. +    onepet=self.petlist;
  801. +    while(onepet) {
  802. +        onepet.enemy=attacker;
  803. +        oldself=self;
  804. +        self=onepet;
  805. +        FoundTarget();
  806. +        self=oldself;
  807. +        onepet = onepet.petlist;
  808. +    }
  809. +
  810.      if (self.weaponframe)
  811.          return;
  812.  
  813. @@ -525,6 +538,9 @@
  814.  {
  815.      local    float    i;
  816.      
  817. +//Added by J. Faske -- if you die, so do your pets
  818. +    KillPets();
  819. +//End addition
  820.      self.items = self.items - (self.items & IT_INVISIBILITY);
  821.      self.invisible_finished = 0;    // don't die as eyes
  822.      self.invincible_finished = 0;
  823. @@ -589,6 +605,12 @@
  824.      self.nextthink = -1;
  825.  };
  826.  
  827. +void(entity e) player_addpet = {
  828. +    e.flags = e.flags | FL_FRIENDLY;
  829. +    e.petlist=self.petlist;
  830. +    e.pet = self;
  831. +    self.petlist=e;
  832. +};
  833.  
  834.  void()    player_diea1    =    [    $deatha1,    player_diea2    ] {};
  835.  void()    player_diea2    =    [    $deatha2,    player_diea3    ] {};
  836. diff -urPBb ..\v101qc/progs.src diff/progs.src
  837. --- ..\v101qc/progs.src    Wed Jul 24 23:51:28 1996
  838. +++ diff/progs.src    Mon Aug 12 15:07:24 1996
  839. @@ -7,6 +7,7 @@
  840.  combat.qc
  841.  items.qc
  842.  weapons.qc
  843. +jsubs.qc
  844.  world.qc
  845.  client.qc
  846.  player.qc
  847. diff -urPBb ..\v101qc/shalrath.qc diff/shalrath.qc
  848. --- ..\v101qc/shalrath.qc    Wed Jul 24 23:51:24 1996
  849. +++ diff/shalrath.qc    Mon Aug 12 12:59:44 1996
  850. @@ -103,17 +103,19 @@
  851.      if (self.health < -90)
  852.      {
  853.          sound (self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM);
  854. -        ThrowHead ("progs/h_shal.mdl", self.health);
  855. -        ThrowGib ("progs/gib1.mdl", self.health);
  856. -        ThrowGib ("progs/gib2.mdl", self.health);
  857. -        ThrowGib ("progs/gib3.mdl", self.health);
  858. +//        ThrowHead ("progs/h_shal.mdl", self.health);
  859. +//        ThrowGib ("progs/gib1.mdl", self.health);
  860. +//        ThrowGib ("progs/gib2.mdl", self.health);
  861. +//        ThrowGib ("progs/gib3.mdl", self.health);
  862. +        monster_gib("progs/h_shal.mdl");
  863.          return;
  864.      }
  865.  
  866.      sound (self, CHAN_VOICE, "shalrath/death.wav", 1, ATTN_NORM);
  867.      shal_death1();
  868. -    self.solid = SOLID_NOT;
  869. +//    self.solid = SOLID_NOT;
  870.      // insert death sounds here
  871. +    monster_corpse_setup('-16 -16 -24', '16 16 -10', "progs/h_shal.mdl");
  872.  };
  873.  
  874.  /*
  875. diff -urPBb ..\v101qc/shambler.qc diff/shambler.qc
  876. --- ..\v101qc/shambler.qc    Wed Jul 24 23:51:24 1996
  877. +++ diff/shambler.qc    Mon Aug 12 14:49:28 1996
  878. @@ -293,7 +293,7 @@
  879.  
  880.  void() sham_death1      =[      $death1,       sham_death2     ] {};
  881.  void() sham_death2      =[      $death2,       sham_death3     ] {};
  882. -void() sham_death3      =[      $death3,       sham_death4     ] {self.solid = SOLID_NOT;};
  883. +void() sham_death3      =[      $death3,       sham_death4     ] {};
  884.  void() sham_death4      =[      $death4,       sham_death5     ] {};
  885.  void() sham_death5      =[      $death5,       sham_death6     ] {};
  886.  void() sham_death6      =[      $death6,       sham_death7     ] {};
  887. @@ -305,20 +305,25 @@
  888.  
  889.  void() sham_die =
  890.  {
  891. +// Added by J. Faske -- removes monster from his petlist
  892. +    RemovePet(self);
  893.  // check for gib
  894.      if (self.health < -60)
  895.      {
  896.          sound (self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM);
  897. -        ThrowHead ("progs/h_shams.mdl", self.health);
  898. -        ThrowGib ("progs/gib1.mdl", self.health);
  899. -        ThrowGib ("progs/gib2.mdl", self.health);
  900. -        ThrowGib ("progs/gib3.mdl", self.health);
  901. +//        ThrowHead ("progs/h_shams.mdl", self.health);
  902. +//        ThrowGib ("progs/gib1.mdl", self.health);
  903. +//        ThrowGib ("progs/gib2.mdl", self.health);
  904. +//        ThrowGib ("progs/gib3.mdl", self.health);
  905. +        monster_gib("progs/h_shams.mdl");
  906.          return;
  907.      }
  908.  
  909.  // regular death
  910.      sound (self, CHAN_VOICE, "shambler/sdeath.wav", 1, ATTN_NORM);
  911.      sham_death1 ();
  912. +      self.health=300;
  913. +    monster_corpse_setup ('-16 -16 -24', '42 42 -4', "progs/h_shams.mdl");
  914.  };
  915.  
  916.  //============================================================================
  917. @@ -326,6 +331,27 @@
  918.  
  919.  /*QUAKED monster_shambler (1 0 0) (-32 -32 -24) (32 32 64) Ambush
  920.  */
  921. +void() _monster_shambler =
  922. +{
  923. +
  924. +    self.solid = SOLID_SLIDEBOX;
  925. +    self.movetype = MOVETYPE_STEP;
  926. +    setmodel (self, "progs/shambler.mdl");
  927. +
  928. +    setsize (self, VEC_HULL2_MIN, VEC_HULL2_MAX);
  929. +    self.health = 600;
  930. +
  931. +    self.th_stand = sham_stand1;
  932. +    self.th_walk = sham_walk1;
  933. +    self.th_run = sham_run1;
  934. +    self.th_die = sham_die;
  935. +    self.th_melee = sham_melee;
  936. +    self.th_missile = sham_magic1;
  937. +    self.th_pain = sham_pain;
  938. +    
  939. +    walkmonster_start();
  940. +};
  941. +
  942.  void() monster_shambler =
  943.  {
  944.      if (deathmatch)
  945. @@ -347,21 +373,5 @@
  946.      precache_sound ("shambler/melee1.wav");
  947.      precache_sound ("shambler/melee2.wav");
  948.      precache_sound ("shambler/smack.wav");
  949. -
  950. -    self.solid = SOLID_SLIDEBOX;
  951. -    self.movetype = MOVETYPE_STEP;
  952. -    setmodel (self, "progs/shambler.mdl");
  953. -
  954. -    setsize (self, VEC_HULL2_MIN, VEC_HULL2_MAX);
  955. -    self.health = 600;
  956. -
  957. -    self.th_stand = sham_stand1;
  958. -    self.th_walk = sham_walk1;
  959. -    self.th_run = sham_run1;
  960. -    self.th_die = sham_die;
  961. -    self.th_melee = sham_melee;
  962. -    self.th_missile = sham_magic1;
  963. -    self.th_pain = sham_pain;
  964. -    
  965. -    walkmonster_start();
  966. +    _monster_shambler();
  967.  };
  968. diff -urPBb ..\v101qc/soldier.qc diff/soldier.qc
  969. --- ..\v101qc/soldier.qc    Wed Jul 24 23:51:24 1996
  970. +++ diff/soldier.qc    Mon Aug 12 14:49:50 1996
  971. @@ -195,7 +195,7 @@
  972.  void()    army_die1    =[    $death1,    army_die2    ] {};
  973.  void()    army_die2    =[    $death2,    army_die3    ] {};
  974.  void()    army_die3    =[    $death3,    army_die4    ]
  975. -{self.solid = SOLID_NOT;self.ammo_shells = 5;DropBackpack();};
  976. +{self.ammo_shells = 5;DropBackpack();};
  977.  void()    army_die4    =[    $death4,    army_die5    ] {};
  978.  void()    army_die5    =[    $death5,    army_die6    ] {};
  979.  void()    army_die6    =[    $death6,    army_die7    ] {};
  980. @@ -207,7 +207,7 @@
  981.  void()    army_cdie1    =[    $deathc1,    army_cdie2    ] {};
  982.  void()    army_cdie2    =[    $deathc2,    army_cdie3    ] {ai_back(5);};
  983.  void()    army_cdie3    =[    $deathc3,    army_cdie4    ]
  984. -{self.solid = SOLID_NOT;self.ammo_shells = 5;DropBackpack();ai_back(4);};
  985. +{self.ammo_shells = 5;DropBackpack();ai_back(4);};
  986.  void()    army_cdie4    =[    $deathc4,    army_cdie5    ] {ai_back(13);};
  987.  void()    army_cdie5    =[    $deathc5,    army_cdie6    ] {ai_back(3);};
  988.  void()    army_cdie6    =[    $deathc6,    army_cdie7    ] {ai_back(4);};
  989. @@ -220,14 +220,17 @@
  990.  
  991.  void() army_die =
  992.  {
  993. +// Added by J. Faske -- removes soldier from his petlist
  994. +    RemovePet(self);
  995.  // check for gib
  996.      if (self.health < -35)
  997.      {
  998.          sound (self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM);
  999. -        ThrowHead ("progs/h_guard.mdl", self.health);
  1000. -        ThrowGib ("progs/gib1.mdl", self.health);
  1001. -        ThrowGib ("progs/gib2.mdl", self.health);
  1002. -        ThrowGib ("progs/gib3.mdl", self.health);
  1003. +//        ThrowHead ("progs/h_guard.mdl", self.health);
  1004. +//        ThrowGib ("progs/gib1.mdl", self.health);
  1005. +//        ThrowGib ("progs/gib2.mdl", self.health);
  1006. +//        ThrowGib ("progs/gib3.mdl", self.health);
  1007. +        monster_gib("progs/h_guard.mdl");
  1008.          return;
  1009.      }
  1010.  
  1011. @@ -237,13 +240,38 @@
  1012.          army_die1 ();
  1013.      else
  1014.          army_cdie1 ();
  1015. +    
  1016. +// We want a corpse:  No actions, a little health, and a new .th_die
  1017. +// Frob some flags so we're damagable as well
  1018. +
  1019. +    monster_corpse_setup('-16 -16 -24', '16 16 -10', "progs/h_guard.mdl");
  1020.  };
  1021.  
  1022.  
  1023.  /*QUAKED monster_army (1 0 0) (-16 -16 -24) (16 16 40) Ambush
  1024.  */
  1025. -void() monster_army =
  1026. +void() _monster_army =
  1027.  {    
  1028. +
  1029. +    self.solid = SOLID_SLIDEBOX;
  1030. +    self.movetype = MOVETYPE_STEP;
  1031. +
  1032. +    setmodel (self, "progs/soldier.mdl");
  1033. +
  1034. +    setsize (self, '-16 -16 -24', '16 16 40');
  1035. +    self.health = 30;
  1036. +
  1037. +    self.th_stand = army_stand1;
  1038. +    self.th_walk = army_walk1;
  1039. +    self.th_run = army_run1;
  1040. +    self.th_missile = army_atk1;
  1041. +    self.th_pain = army_pain;
  1042. +    self.th_die = army_die;
  1043. +
  1044. +    walkmonster_start ();
  1045. +};
  1046. +
  1047. +void() monster_army = {
  1048.      if (deathmatch)
  1049.      {
  1050.          remove(self);
  1051. @@ -263,22 +291,5 @@
  1052.      precache_sound ("soldier/sight1.wav");
  1053.  
  1054.      precache_sound ("player/udeath.wav");        // gib death
  1055. -
  1056. -
  1057. -    self.solid = SOLID_SLIDEBOX;
  1058. -    self.movetype = MOVETYPE_STEP;
  1059. -
  1060. -    setmodel (self, "progs/soldier.mdl");
  1061. -
  1062. -    setsize (self, '-16 -16 -24', '16 16 40');
  1063. -    self.health = 30;
  1064. -
  1065. -    self.th_stand = army_stand1;
  1066. -    self.th_walk = army_walk1;
  1067. -    self.th_run = army_run1;
  1068. -    self.th_missile = army_atk1;
  1069. -    self.th_pain = army_pain;
  1070. -    self.th_die = army_die;
  1071. -
  1072. -    walkmonster_start ();
  1073. +    _monster_army();
  1074.  };
  1075. diff -urPBb ..\v101qc/weapons.qc diff/weapons.qc
  1076. --- ..\v101qc/weapons.qc    Wed Jul 24 23:51:24 1996
  1077. +++ diff/weapons.qc    Thu Aug 15 09:04:44 1996
  1078. @@ -22,6 +22,7 @@
  1079.      precache_sound ("weapons/grenade.wav");    // grenade launcher
  1080.      precache_sound ("weapons/bounce.wav");        // grenade bounce
  1081.      precache_sound ("weapons/shotgn2.wav");    // super shotgun
  1082. +    precache_sound ("zombie/z_hit.wav");    // Axe
  1083.  };
  1084.  
  1085.  float() crandom =
  1086. @@ -48,6 +49,8 @@
  1087.  
  1088.      if (trace_ent.takedamage)
  1089.      {
  1090. +        sound (self, CHAN_WEAPON, "zombie/z_hit.wav", 1, ATTN_NORM);
  1091. +        // Some sort of thunking sound ...
  1092.          trace_ent.axhitme = 1;
  1093.          SpawnBlood (org, '0 0 0', 20);
  1094.          T_Damage (trace_ent, self, self, 20);
  1095. @@ -1152,6 +1155,269 @@
  1096.      dprint ("quad cheat\n");
  1097.  };
  1098.  
  1099. +void() _monster_dog;
  1100. +void() _monster_army;
  1101. +void() _monster_shambler;
  1102. +void() _monster_demon1;
  1103. +void(string model, float health) ThrowGib;
  1104. +void() walkmonster_start_go;
  1105. +void() walkmonster_start;
  1106. +void() PetMove;
  1107. +
  1108. +/*
  1109. +  RemovePet relinks the petlist for self by removing the links for 
  1110. +  entity e
  1111. +  Note:  It does not remove the pet itself; this is left up to the calling program
  1112. +*/
  1113. +void(entity e) RemovePet =
  1114. +{
  1115. +local entity current;
  1116. +
  1117. +if (!e.pet)
  1118. +    return;
  1119. +current = e.pet;
  1120. +while (current.petlist)
  1121. +{
  1122. +    if (current.petlist == e)
  1123. +    {
  1124. +        current.petlist = e.petlist;
  1125. +        return;
  1126. +    }
  1127. +    current = current.petlist;
  1128. +}
  1129. +};
  1130. +/*
  1131. +  KillPets -- by J. Faske
  1132. +  Sometimes a pet is so dumb, euthanasia is the only way to go.
  1133. +  This routine gibs all your current pets
  1134. +  Note: this does not remove the petlist entity, it is removed by 
  1135. +    the th_die routine for the monster
  1136. +*/
  1137. +void() KillPets =
  1138. +{
  1139. +    local entity oldpet, tmppet;
  1140. +    if (!self.petlist)
  1141. +    {
  1142. +        sprint(self,"Sorry, you have no pets.\n");
  1143. +        return;
  1144. +    }
  1145. +    oldpet = self.petlist;
  1146. +    while (oldpet)
  1147. +    {
  1148. +//              oldpet.health = -100 ;
  1149. +//              oldpet.think = oldpet.th_die;
  1150. +//              oldpet.nextthink = time + random()*0.5;
  1151. +        tmppet = oldpet;
  1152. +        oldpet = oldpet.petlist;
  1153. +        T_Damage(tmppet,self,self,300);
  1154. +    }
  1155. +};
  1156. +/*
  1157. +  FindMonster -- added by J. Faske
  1158. +  This routine finds the nearest enemy monster to you.  By the way, it will 
  1159. +  find corpses too.  The monster must be in front of you and in direct sight.
  1160. +*/
  1161. +
  1162. +entity() FindMonster =
  1163. +{
  1164. +    local entity head, selected;
  1165. +    local float dist;
  1166. +    dist = 10000;
  1167. +    selected = world;
  1168. +    head = findradius(self.origin, 10000);
  1169. +    while(head)
  1170. +    {
  1171. +      if( (head.health > 1) && (head != self) && (head != self.owner) && !( (teamplay == 1) && (head.team > 0)&&(head.team == self.owner.team) ) && (head.classname != "door") && (head.classname != "misc_explobox") && !(head.items & IT_INVISIBILITY) && (head.pet != self))
  1172. +         {
  1173. +
  1174. +            traceline(self.origin,head.origin,TRUE,self);
  1175. +            if ( (trace_fraction >= 1) && (vlen(head.origin - self.origin) < dist) && (infront(head)))
  1176. +            {
  1177. +                selected = head;
  1178. +                dist = vlen(head.origin - self.origin);
  1179. +            }
  1180. +        }
  1181. +        head = head.chain;
  1182. +    }
  1183. +
  1184. +    return selected;
  1185. +};
  1186. +/*
  1187. +  FindDead -- Added by J. Faske
  1188. +  This routine finds the nearest dead corpse that is a Dog, a Grunt, a
  1189. +  Fiend (demon) or a Shambler (cool having a pet Shambler, don't ya think?)
  1190. +  Note: you must save your current health before this is run because it
  1191. +  deducts the penalty from it automatically.  If you do not have enough
  1192. +  health, too bad, no pet.
  1193. +*/
  1194. +entity() FindDead =
  1195. +{
  1196. +    local entity head, selected;
  1197. +    local float dist, temp, hlth;
  1198. +    
  1199. +    hlth = 0;
  1200. +    dist = 1000;
  1201. +    selected = world;
  1202. +    head = findradius(self.origin, 200);
  1203. +    while(head)
  1204. +    {
  1205. +      temp = 0;
  1206. +      if ((head.classname == "dog_corpse")&&(self.health > 25))
  1207. +        temp = 25;
  1208. +      if ((head.classname == "army_corpse")&&(self.health > 50))
  1209. +        temp = 50;
  1210. +      if ((head.classname == "demon1_corpse")&&(self.health > 90))
  1211. +        temp = 90;
  1212. +      if ((head.classname == "shambler_corpse")&&(self.health > 99))
  1213. +        temp = 99;
  1214. +      if (temp!=0)
  1215. +         {
  1216. +            traceline(self.origin,head.origin,TRUE,self);
  1217. +            if ( (trace_fraction >= 1) && (vlen(head.origin - self.origin) < dist) && (infront(head)))
  1218. +            {
  1219. +                selected = head;
  1220. +                dist = vlen(head.origin - self.origin);
  1221. +                hlth = temp;
  1222. +            }
  1223. +        }
  1224. +        head = head.chain;
  1225. +    }
  1226. +    self.health = self.health - hlth;
  1227. +    return selected;
  1228. +};
  1229. +/*
  1230. +  Resurrect -- added by J. Faske
  1231. +  This routine resurrects the entity f into the owner's pet.
  1232. +*/
  1233. +void(vector org) spawn_tfog;
  1234. +void(entity f) Resurrect =
  1235. +{
  1236. +    local entity myself;
  1237. +
  1238. +    player_addpet(f);
  1239. +    f.touch=PetMove;
  1240. +    f.pet=f.enemy=f.movetarget=f.goalentity=self;
  1241. +    f.angles=self.angles;
  1242. +    f.owner=world;
  1243. +    f.flags=f.flags|FL_MONSTER;
  1244. +    myself = self;
  1245. +    self = f;
  1246. +    spawn_tfog (self.origin);
  1247. +    if(f.classname == "dog_corpse"){
  1248. +        f.classname = "monster_dog";
  1249. +        f.origin = f.origin + '0 0 41';
  1250. +        //setorigin (self, self.origin + '0 0 91');
  1251. +        _monster_dog();
  1252. +    } else if(f.classname == "army_corpse") {
  1253. +        f.classname = "monster_army";
  1254. +        f.origin = f.origin + '0 0 41';
  1255. +        //setorigin (self, self.origin + '0 0 91');
  1256. +        _monster_army();
  1257. +    } else if(f.classname == "demon1_corpse") {
  1258. +        f.classname = "monster_demon1";
  1259. +        f.origin = f.origin + '0 0 64';
  1260. +        _monster_demon1();
  1261. +    } else if (f.classname == "shambler_corpse") {
  1262. +        f.classname = "monster_shambler";
  1263. +        f.origin = f.origin + '0 0 64';
  1264. +        _monster_shambler();
  1265. +    }
  1266. +    else
  1267. +    {
  1268. +        self = myself;
  1269. +        RemovePet(f);
  1270. +        return;
  1271. +    }
  1272. +    walkmonster_start_go();
  1273. +    sprint(myself,"You have a new pet ");
  1274. +    sprint(myself,self.classname);
  1275. +    sprint(myself,"\n");
  1276. +    FoundTarget();
  1277. +    self = myself;
  1278. +};
  1279. +
  1280. +/*
  1281. +  ResurrectPet -- Added by J. Faske
  1282. +  This routine resurrects the closest corpse into a pet.  You can then order
  1283. +  your pet to attack or come.
  1284. +*/
  1285. +void() ResurrectPet =
  1286. +{
  1287. +    local entity monster;
  1288. +    local float oldhlth, dodmg;
  1289. +    if (self.petlist)    //Sorry, only one pet per customer
  1290. +        return;
  1291. +    oldhlth = self.health;
  1292. +    monster = FindDead();
  1293. +    if (monster == world)
  1294. +    {
  1295. +        sprint(self,"No dead guys to resurrect as pets\n");
  1296. +        return;
  1297. +    }
  1298. +    dodmg = oldhlth - self.health;
  1299. +    self.health = oldhlth;
  1300. +    if(!(deathmatch || coop || (self.flags & FL_GODMODE)))
  1301. +        T_Damage(self,self,self,dodmg);
  1302. +    Resurrect(monster);
  1303. +};
  1304. +/*
  1305. +  GoMaul -- added by J. Faske
  1306. +  This routine tells your pet (we'll just call him Spot, ok?) to attack a
  1307. +  monster you are looking at.
  1308. +*/
  1309. +void() GoMaul =
  1310. +{
  1311. +local entity spot,monster,oldself;
  1312. +
  1313. +spot = self.petlist;
  1314. +if (!spot)
  1315. +{
  1316. +    sprint(self,"Damn that dog... he's run away again!\n");
  1317. +    return;
  1318. +}
  1319. +monster = FindMonster();
  1320. +if (monster == world)
  1321. +{
  1322. +    sprint(self, "Sorry Spot. There's no one to play with.\n");
  1323. +    return ;
  1324. +}
  1325. +sprint(self,"Spot! Attack the ");
  1326. +sprint(self,monster.classname);
  1327. +sprint(self,"\n");
  1328. +
  1329. +while (spot)
  1330. +{
  1331. +    spot.enemy = spot.movetarget=spot.goalentity=monster;
  1332. +    spot.think = FoundTarget;
  1333. +    spot.nextthink = time + 0.1;
  1334. +    spot = spot.petlist;
  1335. +}
  1336. +};
  1337. +/*
  1338. +  HereBoy -- added by J. Faske
  1339. +  This routine calls off the attack and has your pet return to you.
  1340. +*/
  1341. +void() HereBoy =
  1342. +{
  1343. +local entity spot,oldself;
  1344. +
  1345. +spot = self.petlist;
  1346. +if (!spot)
  1347. +{
  1348. +    sprint(self,"Damn that dog... he's run away again!\n");
  1349. +    return;
  1350. +}
  1351. +sprint(self,"Spot! Here boy!!\n");
  1352. +
  1353. +while (spot)
  1354. +{
  1355. +    spot.enemy = spot.movetarget=spot.goalentity=self;
  1356. +    spot.nextthink = time + 0.1;
  1357. +    spot.think = FoundTarget;
  1358. +    spot = spot.petlist;
  1359. +}
  1360. +};
  1361. +
  1362.  /*
  1363.  ============
  1364.  ImpulseCommands
  1365. @@ -1170,6 +1436,14 @@
  1366.      if (self.impulse == 11)
  1367.          ServerflagsCommand ();
  1368.  
  1369. +    if (self.impulse == 250)
  1370. +        ResurrectPet ();
  1371. +    if (self.impulse == 55)
  1372. +        KillPets ();
  1373. +    if (self.impulse == 56)
  1374. +        GoMaul ();
  1375. +    if (self.impulse == 57)
  1376. +        HereBoy ();
  1377.      if (self.impulse == 255)
  1378.          QuadCheat ();
  1379.          
  1380. diff -urPBb ..\v101qc/wizard.qc diff/wizard.qc
  1381. --- ..\v101qc/wizard.qc    Wed Jul 24 23:51:24 1996
  1382. +++ diff/wizard.qc    Mon Aug 12 12:59:50 1996
  1383. @@ -331,7 +331,7 @@
  1384.  sound (self, CHAN_VOICE, "wizard/wdeath.wav", 1, ATTN_NORM);
  1385.  };
  1386.  void()    wiz_death2    =[    $death2,        wiz_death3    ] {};
  1387. -void()    wiz_death3    =[    $death3,        wiz_death4    ]{self.solid = SOLID_NOT;};
  1388. +void()    wiz_death3    =[    $death3,        wiz_death4    ] {};
  1389.  void()    wiz_death4    =[    $death4,        wiz_death5    ] {};
  1390.  void()    wiz_death5    =[    $death5,        wiz_death6    ] {};
  1391.  void()    wiz_death6    =[    $death6,        wiz_death7    ] {};
  1392. @@ -344,14 +344,18 @@
  1393.      if (self.health < -40)
  1394.      {
  1395.          sound (self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM);
  1396. -        ThrowHead ("progs/h_wizard.mdl", self.health);
  1397. -        ThrowGib ("progs/gib2.mdl", self.health);
  1398. -        ThrowGib ("progs/gib2.mdl", self.health);
  1399. -        ThrowGib ("progs/gib2.mdl", self.health);
  1400. +//        ThrowHead ("progs/h_wizard.mdl", self.health);
  1401. +//        ThrowGib ("progs/gib2.mdl", self.health);
  1402. +//        ThrowGib ("progs/gib2.mdl", self.health);
  1403. +//        ThrowGib ("progs/gib2.mdl", self.health);
  1404. +        monster_gib("progs/h_wizard.mdl");
  1405. +        sound(self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM);
  1406.          return;
  1407.      }
  1408.  
  1409.      wiz_death1 ();
  1410. +      self.health=135;
  1411. +    monster_corpse_setup('-16 -16 -24', '16 16 -10', "progs/h_wizard.mdl");
  1412.  };
  1413.  
  1414.  
  1415. diff -urPBb ..\v101qc/world.qc diff/world.qc
  1416. --- ..\v101qc/world.qc    Wed Jul 24 23:51:24 1996
  1417. +++ diff/world.qc    Mon Aug 12 12:59:52 1996
  1418. @@ -190,6 +190,64 @@
  1419.      precache_sound ("misc/h2ohit1.wav");        // landing splash
  1420.  
  1421.  // setup precaches allways needed
  1422. +
  1423. +// Dog stuff
  1424. +    precache_model ("progs/h_dog.mdl");
  1425. +    precache_model ("progs/dog.mdl");
  1426. +
  1427. +    precache_sound ("dog/dattack1.wav");
  1428. +    precache_sound ("dog/ddeath.wav");
  1429. +    precache_sound ("dog/dpain1.wav");
  1430. +    precache_sound ("dog/dsight.wav");
  1431. +    precache_sound ("dog/idle.wav");
  1432. +// End dog stuff 
  1433. +
  1434. +// Soldier stuff
  1435. +    precache_model ("progs/soldier.mdl");
  1436. +    precache_model ("progs/h_guard.mdl");
  1437. +    precache_model ("progs/gib1.mdl");
  1438. +    precache_model ("progs/gib2.mdl");
  1439. +    precache_model ("progs/gib3.mdl");
  1440. +
  1441. +    precache_sound ("soldier/death1.wav");
  1442. +    precache_sound ("soldier/idle.wav");
  1443. +    precache_sound ("soldier/pain1.wav");
  1444. +    precache_sound ("soldier/pain2.wav");
  1445. +    precache_sound ("soldier/sattck1.wav");
  1446. +    precache_sound ("soldier/sight1.wav");
  1447. +
  1448. +    precache_sound ("player/udeath.wav");        // gib death
  1449. +// End of soldier stuff
  1450. +
  1451. +// Demon stuff
  1452. +    precache_model ("progs/demon.mdl");
  1453. +    precache_model ("progs/h_demon.mdl");
  1454. +
  1455. +    precache_sound ("demon/ddeath.wav");
  1456. +    precache_sound ("demon/dhit2.wav");
  1457. +    precache_sound ("demon/djump.wav");
  1458. +    precache_sound ("demon/dpain1.wav");
  1459. +    precache_sound ("demon/idle1.wav");
  1460. +    precache_sound ("demon/sight2.wav");
  1461. +// End of demon
  1462. +
  1463. +// Shambler
  1464. +    precache_model ("progs/shambler.mdl");
  1465. +    precache_model ("progs/s_light.mdl");
  1466. +    precache_model ("progs/h_shams.mdl");
  1467. +    precache_model ("progs/bolt.mdl");
  1468. +    
  1469. +    precache_sound ("shambler/sattck1.wav");
  1470. +    precache_sound ("shambler/sboom.wav");
  1471. +    precache_sound ("shambler/sdeath.wav");
  1472. +    precache_sound ("shambler/shurt2.wav");
  1473. +    precache_sound ("shambler/sidle.wav");
  1474. +    precache_sound ("shambler/ssight.wav");
  1475. +    precache_sound ("shambler/melee1.wav");
  1476. +    precache_sound ("shambler/melee2.wav");
  1477. +    precache_sound ("shambler/smack.wav");
  1478. +// End of shambler
  1479. +
  1480.      precache_sound ("items/itembk2.wav");        // item respawn sound
  1481.      precache_sound ("player/plyrjmp8.wav");        // player jump
  1482.      precache_sound ("player/land.wav");            // player landing
  1483.